package com.example.spareparts.service;


import com.example.spareparts.entity.SparePart;
import com.example.spareparts.repository.SparePartRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SparePartService {
    @Autowired
    private SparePartRepository sparePartRepository;

    public List<SparePart> findAllSparePart() {
        return sparePartRepository.findAllSparePart();
    }
    public void insertSparePart(SparePart sparePart) {
        sparePartRepository.insertSparePart(sparePart);
    }
    public void updateSparePart(SparePart sparePart) {
        sparePartRepository.updateSparePart(sparePart);
    }
    public void deleteSparePart(Long sparepartid) {
        sparePartRepository.deleteSparePart(sparepartid);
    }
    public SparePart findSparePartById(Long sparepartid) {
        return sparePartRepository.findSparePartById(sparepartid);
    }
    public List<SparePart> findSparePartBySupplierId(Long supplierid) {
        return sparePartRepository.findSparePartBySupplierId(supplierid);
    }


}